package pers.qianyu.month_202012.date_20201219.bit_operation;

/**
 * 231. 2的幂
 * https://leetcode-cn.com/problems/power-of-two/
 *
 * @author mizzle rain
 * @date 2020-12-19 21:30
 */
public class IsPowerOfTwo {
    public boolean isPowerOfTwo(int n) {
        if (n <= 0) {
            return false;
        }
        return (n & (n - 1)) == 0;
    }
}
